package com.pattern.command.tenant;

import com.pattern.command.frame.Command;
import com.pattern.command.third.Service3;

public class Command3 implements Command {
    private String userName;
    private String orderNo;

    public Command3(String username, String orderNo) {
        this.userName = username;
        this.orderNo = orderNo;
    }

    @Override
    public boolean execute() {
        // 此处调用 RPC
        return Service3.bindUserOrder(userName, orderNo);
    }

    @Override
    public boolean undo() {
        // 此处调用 RPC 接口的逆向接口
        return Service3.unbindUserOrder(userName, orderNo);
    }
}
